function a(){
    let money = 1000
    return (val)=> {
        money -=val
        console.log(money)
    }
}
var b =a()
b(100)
b(100)
